package com.rykj.qxj.server.services;

import com.github.pagehelper.PageInfo;
import com.rykj.qxj.server.model.entity.DatabaseSource;


public interface IDatabaseSourceService {

    public String saveDatabaseSource(DatabaseSource databaseSource) throws Exception;

    /**
     * 检测ip下数据库是否存在
     * @param databaseName
     * @param databaseIP
     * @return
     */
    public boolean databaseIfExist(String databaseName, String databaseIP) ;

    public void updateDatabaseSource(DatabaseSource databaseSource);

    public void deleteDatabaseSourceById(Integer baseSourcId);

    public PageInfo getDatabaseSourceList(Integer pageNum, Integer pageSize, String classification, String databaseName,String databaseCNName,String directory,Integer appId,String databaseType);

    public DatabaseSource getDatabaseSourceDetails(Integer id);

    public String createDatabase(DatabaseSource databaseSource) throws  Exception;

    /**
     * 检测连接是否成功
     * @param databaseIp
     * @param userName
     * @param password
     * @return
     */
    public String checkConnect(String databaseIp,String prot, String userName, String password) ;

    DatabaseSource getSzqxReadDataSource();
}
